---
layout: "default"
title: "RandomAccessReverseView"
description: "Swift documentation for 'RandomAccessReverseView': The lazy CollectionType returned by reverse(c) where c is a."
keywords: "RandomAccessReverseView,struct,swift,documentation,generate,endIndex,startIndex,Index,Generator,Element,Index,SubSequence"
root: "/v1.2"
---

<div class="intro-declaration"><code class="language-swift">struct RandomAccessReverseView&lt;T : CollectionType where T.Index : RandomAccessIndexType&gt;</code></div>

<div class="discussion comment">
    <p>The lazy <code>CollectionType</code> returned by <code>reverse(c)</code> where <code>c</code> is a
<code>CollectionType</code> with an <code>Index</code> conforming to <code>RandomAccessIndexType</code></p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">CollectionType, SequenceType, _CollectionType, _SequenceType, _Sequence_Type</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>

<tr>
<th id="aliases">Associated Types</th>
<td>
<span id="aliasesmark"></span>
<div class="declaration">
<code class="language-swift">Index = ReverseRandomAccessIndex&lt;T.Index&gt;</code>
<div class="comment">
    <p>A type that represents a valid position in the collection.</p>

<p>Valid indices consist of the position of every element and a
&quot;past the end&quot; position that&#39;s not valid for use as a subscript.</p>
</div>
</div>
<div class="declaration">
<code class="language-swift">Generator = IndexingGenerator&lt;RandomAccessReverseView&lt;T&gt;&gt;</code>
<div class="comment">
    <p>A type whose instances can produce the elements of this
sequence, in order.</p>
</div>
</div>
<div class="declaration">
<code class="language-swift">Element = T.Generator.Element</code>
<div class="comment">
    <p><em>Type alias inferred.</em></p>
</div>
</div>
<div class="declaration">
<code class="language-swift">Index = Index</code>
<div class="comment">
    <p><em>Type alias inferred.</em></p>
</div>
</div>
<div class="declaration">
<code class="language-swift">SubSequence = Slice&lt;RandomAccessReverseView&lt;T&gt;&gt;</code>
<div class="comment">
    <p><em>Type alias inferred.</em></p>
</div>
</div>
</td>
</tr>


<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>




<h3>Instance Variables</h3>
<div class="declaration" id="var-endindex_-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-endindex_-index">var endIndex: Index</a><div class="comment collapse" id="comment-var-endindex_-index"><div class="p">
    <p>The collection&#39;s &quot;past the end&quot; position.</p>

<p><code>endIndex</code> is not a valid argument to <code>subscript</code>, and is always
reachable from <code>startIndex</code> by zero or more applications of
<code>successor()</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var endIndex: Index { get }</code>

    </div></div>
</div>
<div class="declaration" id="var-startindex_-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-startindex_-index">var startIndex: Index</a><div class="comment collapse" id="comment-var-startindex_-index"><div class="p">
    <p>The position of the first element in a non-empty collection.</p>

<p>Identical to <code>endIndex</code> in an empty collection.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var startIndex: Index { get }</code>

    </div></div>
</div>

<h3>Subscripts</h3>
<div class="declaration" id="subscript-subscript_-index">
<a class="toggle-link" data-toggle="collapse" href="#comment-subscript-subscript_-index">subscript(_: Index)</a>
<div class="comment collapse" id="comment-subscript-subscript_-index"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">subscript(position: Index) -&gt; T.Generator.Element { get }</code>
    
    
</div></div>
</div>


<h3>Instance Methods</h3>
<div class="declaration" id="func-generate">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-generate">func generate()</a>
        
<div class="comment collapse" id="comment-func-generate"><div class="p">
    <p>Return a <em>generator</em> over the elements of this <em>sequence</em>.</p>

<p>Complexity: O(1)</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func generate() -&gt; IndexingGenerator&lt;RandomAccessReverseView&lt;T&gt;&gt;</code>
    
    
</div></div>
</div>


